Fk:loadTranslationTable({
    ["bomuai"] = "<b>目隘</b>",
    [":bomuai"] = "&nbsp;[锁定技]&nbsp; 你造成或受到的伤害 + x &nbsp;&nbsp;(x为“失”标记数)。</p>",
    ["@shi"] = "失", -- 标记名（与逃寇一致）
    ["#bomuai-distance"] = "距离调整：-{}",
    ["#bomuai-damage"] = "伤害调整：+{}",
    ["$bomuai1"] = "祢衡狂傲该杀，甘宁去留无妨！小小失误，怎碍我万箭破敌！",
    ["$bomuai2"] = "昔日目隘失良才，今日以箭讨旧债！放！"
})

local bomuai = fk.CreateSkill({
    name = "bomuai",
    tags = {Skill.Compulsory}, -- 锁定技标签（与咆哮一致）
})

-- 1. 距离双向调整（参考咆哮的targetmod效果）
bomuai:addEffect("targetmod", {
    bypass_times = function(self, player, skill, scope, card)
        -- 仅当计算与自己的距离时，应用标记数x
        return player:hasSkill(bomuai.name) and scope == Player.Distance and 
               (skill.from:isSamePlayer(player) or skill.to:isSamePlayer(player))
    end,
    distance_modifier = function(self, player, from, to)
        local x = player:getMark("@shi") or 0
        return -x, -x -- 双向距离减少x
    end,
})

-- 2. 造成伤害增加（参考咆哮的DamageCaused效果）
bomuai:addEffect(fk.DamageCaused, {
    mute = true, -- 无发动提示
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(bomuai.name) and data.from == player -- 仅自己造成伤害时触发
    end,
    on_use = function(self, event, target, player, data)
        local x = player:getMark("@shi") or 0
        data:changeDamage(x) -- 伤害增加x
        player:broadcastSkillInvoke(bomuai.name) -- 广播技能发动
    end,
})

-- 3. 受到伤害增加（新增效果，类似造成伤害逻辑）
bomuai:addEffect(fk.DamageInflicted, {
    mute = true,
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(bomuai.name) and data.to == player -- 仅自己受到伤害时触发
    end,
    on_use = function(self, event, target, player, data)
        local x = player:getMark("@shi") or 0
        data:changeDamage(x) -- 伤害增加x
    end,
})

return bomuai
